Problem with DBE placement

Sorry to bother you again.
But spend most of my college years using only Java to build GUI (you know drag and drop Java feature) I've been finding great difficulty in doing it on DOORS.
The most serious problem is the placement...
The thing is, I can't even see if I did it right, because the follow message appear:

-R-E- DXL: <Line:365> An unexpected error has occurred: doors.exe caused an EXCEPTION_ACCESS_VIOLATION in module doors.exe at 001B:006DACDB

-I- DXL: execution halted

But see I did this:
 

// Start to buid GUI
if(canInit()){ 
    
   // Creation of Buttons and function associated to 'close'
        prevButton = apply(verEvidenceBox, "<<&Previous Req", selectPrev)
        nextButton = apply(verEvidenceBox, "&Next Req>>", selectNext)
        saveButton = apply(verEvidenceBox, "&Save Module", saveReport)
        close(verEvidenceBox, true, closeBox)
 
        // Shows Proposed Checker, Tag and Requirement  
        tagField = field(verEvidenceBox, "Tag:", identifier(obj), 20, true)
        sigdescrField = field(verEvidenceBox, "Signal Description:", obj."Signal Description" "", 20, true)
        resulField = field(verEvidenceBox, "Resolution:", obj."Resolution" "", 20, true)
        richTextReq = field(verEvidenceBox, "Signal Name", obj."Object Text" "" , 20, true)
        dtmaxField = field(verEvidenceBox, "Dt Max:", obj."Data Max" "", 20, true)
        dtminField = field(verEvidenceBox, "Dt Min:", obj."Data Min" "", 20, true)
        dtvmaxField = field(verEvidenceBox, "Dt Valid Max", obj."Data Valid Max" "" , 20, true)
        dtvminField = field(verEvidenceBox, "Dt Valid Min", obj."Data Valid Min" "" , 20, true)
        
        tagField->"top"->"flush"
        tagField->"left"->"flush"
        tagField->"bottom"->"unattached"->dtmaxField
        
        richTextReq->"left"->"flush"->tagField
        richTextReq->"top"->"aligned"->tagField
        richTextReq->"bottom"->"unattached"->dtminField
        
        sigdescrField->"left"->"flush"->richTextReq
        sigdescrField->"top"->"aligned"->richTextReq
        sigdescrField->"bottom"->"unattached"->dtvmaxField
                
        resulField->"left"->"flush"->sigdescrField
        resulField->"top"->"aligned"->sigdescrField
        resulField->"bottom"->"unattached"->dtvminField
        resulField->"right"->"unattached"
        
        dtmaxField->"top"->"spaced"->tagField
        dtmaxField->"left"->"aligned"->tagField
        dtmaxField->"bottom"->"spaced"
        
        dtminField->"left"->"flush"->dtmaxField
        dtminField->"top"->"spaced"->richTextReq
        dtminField->"bottom"->"spaced"
        
        dtvmaxField->"left"->"flush"->dtminField
        dtvmaxField->"top"->"spaced"->sigdescrField
        dtvmaxField->"bottom"->"spaced"
                
        dtvminField->"left"->"flush"->dtvmaxField
        dtvminField->"top"->"spaced"->resulField
        dtvminField->"bottom"->"spaced"
        dtvminField->"right"->"unattached"
        
 
        
        // Questions 
        selectChoiceQ1 = choice(verEvidenceBox, "Q1:?", options, 1, 13,false)
        DBE t1 = button(verEvidenceBox, "Show Details", selectDetails1) 
        t1 -> "left" -> "flush" -> selectChoiceQ1
        t1 -> "top" -> "aligned" -> selectChoiceQ1
        
        selectChoiceQ2 = choice(verEvidenceBox, "Q2:?", options, 1, 13,false) 
        t2 = button(verEvidenceBox, "Show Details", selectDetails2) 
        t2 -> "left" -> "flush" -> selectChoiceQ2
        t2 -> "top" -> "aligned" -> selectChoiceQ2
        
        selectChoiceQ3 = choice(verEvidenceBox, "Q3:", options, 1, 13,false)
        t3 = button(verEvidenceBox, "Show Details", selectDetails3) 
        t3 -> "left" -> "flush" -> selectChoiceQ3
        t3 -> "top" -> "aligned" -> selectChoiceQ3 
        
        statusField = field(verEvidenceBox, "Status", "", 13, true)
        
        updateVariables()
        show verEvidenceBox
}

 


If anyone can tell me if Im on the right direction, it would be enough!
Thanks again!

 


Bruwbruw - Tue Aug 07 10:05:13 EDT 2012

Re: Problem with DBE placement
Mathias Mamsch - Tue Aug 07 10:26:38 EDT 2012

There is some written and some unwritten rules and some guidelines with constrained placement:
 

  • Create elements in the order they are on the screen from left to right, from top to bottom
  • immediately place the elements, to be sure specify all four edges
  • Some placements do not work as expected. Instead of using aligned you can also place one element just like the other
  • Attach top and left to place the element. Attach right and bottom only when you want to stretch things. Aligning multiple elements from right to left does not work.


After small modifications to your code, it shows a gui without crashing. Is this what you indented? Maybe that helps, Regards, Mathias

 

 

DB verEvidenceBox = centered "Test"
void selectPrev(DB) {}
void selectNext(DB) {}
void saveReport(DB) {}
 
DBE prevButton 
DBE nextButton 
DBE saveButton 
DBE tagField 
DBE richTextReq 
DBE sigdescrField 
DBE resulField 
DBE dtmaxField 
DBE dtminField
DBE dtvmaxField
DBE dtvminField
 
prevButton = apply(verEvidenceBox, "<<&Previous Req", selectPrev)
nextButton = apply(verEvidenceBox, "&Next Req>>", selectNext)
saveButton = apply(verEvidenceBox, "&Save Module", saveReport)
// close(verEvidenceBox, true, closeBox)
 
// Shows Proposed Checker, Tag and Requirement    
tagField = field(verEvidenceBox, "Tag:", "", 20, true)
tagField->"top"->"form"  // to attach to the form use 'form', not 'flush'
tagField->"left"->"form"
tagField->"bottom"->"unattached" // <<- unattached does not go with a value
 
// Declare fields in the order on the screen from top left. Place them immediately
richTextReq = field(verEvidenceBox, "Signal Name", "" , 20, true)
richTextReq->"left"->"flush"->tagField
// instead of aligned use the same value as the other field
// so insteadof 'richTextReq->"top"->"aligned"->tagField' do
richTextReq->"top"->"form"
richTextReq->"bottom"->"unattached" // <<- unattached does not go with a value
 
sigdescrField = field(verEvidenceBox, "Signal Description:","" "", 20, true)
sigdescrField->"left"->"flush"->richTextReq
sigdescrField->"top"->"aligned"->richTextReq
sigdescrField->"bottom"->"unattached" // <<- unattached does not go with a value
 
resulField = field(verEvidenceBox, "Resolution:","" "", 20, true)
resulField->"left"->"flush"->sigdescrField
resulField->"top"->"aligned"->sigdescrField
resulField->"bottom"->"unattached" 
resulField->"right"->"unattached" // <<- unattached does not go with a value
 
dtmaxField = field(verEvidenceBox, "Dt Max:", "", 20, true)
dtmaxField->"top"->"spaced"->tagField
dtmaxField->"left"->"aligned"->tagField
dtmaxField->"bottom"->"spaced"
        
dtminField = field(verEvidenceBox, "Dt Min:","", 20, true)
dtminField->"left"->"flush"->dtmaxField
dtminField->"top"->"spaced"->richTextReq
dtminField->"bottom"->"spaced"
        
dtvmaxField = field(verEvidenceBox, "Dt Valid Max","" , 20, true)
dtvmaxField->"left"->"flush"->dtminField
dtvmaxField->"top"->"spaced"->sigdescrField
dtvmaxField->"bottom"->"spaced"
                
dtvminField = field(verEvidenceBox, "Dt Valid Min",  "" , 20, true)
dtvminField->"left"->"flush"->dtvmaxField
dtvminField->"top"->"spaced"->resulField
dtvminField->"bottom"->"spaced"
dtvminField->"right"->"unattached"
        
string options[] = {"Option 1", "Option 2", "Option 3" }
 
void selectDetails1(DBE) { }
void selectDetails2(DBE) { }
void selectDetails3(DBE) { }
        
// Questions 
DBE selectChoiceQ1 = choice(verEvidenceBox, "Q1:?", options, 1, 13,false)
DBE t1 = button(verEvidenceBox, "Show Details", selectDetails1) 
t1 -> "left" -> "flush" -> selectChoiceQ1
t1 -> "top" -> "aligned" -> selectChoiceQ1
        
DBE selectChoiceQ2 = choice(verEvidenceBox, "Q2:?", options, 1, 13,false)     
DBE t2 = button(verEvidenceBox, "Show Details", selectDetails2) 
t2 -> "left" -> "flush" -> selectChoiceQ2
t2 -> "top" -> "aligned" -> selectChoiceQ2
        
DBE selectChoiceQ3 = choice(verEvidenceBox, "Q3:", options, 1, 13,false)
DBE t3 = button(verEvidenceBox, "Show Details", selectDetails3) 
t3 -> "left" -> "flush" -> selectChoiceQ3
t3 -> "top" -> "aligned" -> selectChoiceQ3 
        
DBE statusField = field(verEvidenceBox, "Status", "", 13, true)
        
show verEvidenceBox

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Problem with DBE placement
llandale - Tue Aug 07 11:13:11 EDT 2012

Mathias Mamsch - Tue Aug 07 10:26:38 EDT 2012

There is some written and some unwritten rules and some guidelines with constrained placement:
 

  • Create elements in the order they are on the screen from left to right, from top to bottom
  • immediately place the elements, to be sure specify all four edges
  • Some placements do not work as expected. Instead of using aligned you can also place one element just like the other
  • Attach top and left to place the element. Attach right and bottom only when you want to stretch things. Aligning multiple elements from right to left does not work.


After small modifications to your code, it shows a gui without crashing. Is this what you indented? Maybe that helps, Regards, Mathias

 

 

DB verEvidenceBox = centered "Test"
void selectPrev(DB) {}
void selectNext(DB) {}
void saveReport(DB) {}
 
DBE prevButton 
DBE nextButton 
DBE saveButton 
DBE tagField 
DBE richTextReq 
DBE sigdescrField 
DBE resulField 
DBE dtmaxField 
DBE dtminField
DBE dtvmaxField
DBE dtvminField
 
prevButton = apply(verEvidenceBox, "<<&Previous Req", selectPrev)
nextButton = apply(verEvidenceBox, "&Next Req>>", selectNext)
saveButton = apply(verEvidenceBox, "&Save Module", saveReport)
// close(verEvidenceBox, true, closeBox)
 
// Shows Proposed Checker, Tag and Requirement    
tagField = field(verEvidenceBox, "Tag:", "", 20, true)
tagField->"top"->"form"  // to attach to the form use 'form', not 'flush'
tagField->"left"->"form"
tagField->"bottom"->"unattached" // <<- unattached does not go with a value
 
// Declare fields in the order on the screen from top left. Place them immediately
richTextReq = field(verEvidenceBox, "Signal Name", "" , 20, true)
richTextReq->"left"->"flush"->tagField
// instead of aligned use the same value as the other field
// so insteadof 'richTextReq->"top"->"aligned"->tagField' do
richTextReq->"top"->"form"
richTextReq->"bottom"->"unattached" // <<- unattached does not go with a value
 
sigdescrField = field(verEvidenceBox, "Signal Description:","" "", 20, true)
sigdescrField->"left"->"flush"->richTextReq
sigdescrField->"top"->"aligned"->richTextReq
sigdescrField->"bottom"->"unattached" // <<- unattached does not go with a value
 
resulField = field(verEvidenceBox, "Resolution:","" "", 20, true)
resulField->"left"->"flush"->sigdescrField
resulField->"top"->"aligned"->sigdescrField
resulField->"bottom"->"unattached" 
resulField->"right"->"unattached" // <<- unattached does not go with a value
 
dtmaxField = field(verEvidenceBox, "Dt Max:", "", 20, true)
dtmaxField->"top"->"spaced"->tagField
dtmaxField->"left"->"aligned"->tagField
dtmaxField->"bottom"->"spaced"
        
dtminField = field(verEvidenceBox, "Dt Min:","", 20, true)
dtminField->"left"->"flush"->dtmaxField
dtminField->"top"->"spaced"->richTextReq
dtminField->"bottom"->"spaced"
        
dtvmaxField = field(verEvidenceBox, "Dt Valid Max","" , 20, true)
dtvmaxField->"left"->"flush"->dtminField
dtvmaxField->"top"->"spaced"->sigdescrField
dtvmaxField->"bottom"->"spaced"
                
dtvminField = field(verEvidenceBox, "Dt Valid Min",  "" , 20, true)
dtvminField->"left"->"flush"->dtvmaxField
dtvminField->"top"->"spaced"->resulField
dtvminField->"bottom"->"spaced"
dtvminField->"right"->"unattached"
        
string options[] = {"Option 1", "Option 2", "Option 3" }
 
void selectDetails1(DBE) { }
void selectDetails2(DBE) { }
void selectDetails3(DBE) { }
        
// Questions 
DBE selectChoiceQ1 = choice(verEvidenceBox, "Q1:?", options, 1, 13,false)
DBE t1 = button(verEvidenceBox, "Show Details", selectDetails1) 
t1 -> "left" -> "flush" -> selectChoiceQ1
t1 -> "top" -> "aligned" -> selectChoiceQ1
        
DBE selectChoiceQ2 = choice(verEvidenceBox, "Q2:?", options, 1, 13,false)     
DBE t2 = button(verEvidenceBox, "Show Details", selectDetails2) 
t2 -> "left" -> "flush" -> selectChoiceQ2
t2 -> "top" -> "aligned" -> selectChoiceQ2
        
DBE selectChoiceQ3 = choice(verEvidenceBox, "Q3:", options, 1, 13,false)
DBE t3 = button(verEvidenceBox, "Show Details", selectDetails3) 
t3 -> "left" -> "flush" -> selectChoiceQ3
t3 -> "top" -> "aligned" -> selectChoiceQ3 
        
DBE statusField = field(verEvidenceBox, "Status", "", 13, true)
        
show verEvidenceBox

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

I emphasize 1st and 4th rules; which together imply rule 5:you should never attach a DBE to a DBE that was declared after it.
I didn't read your code nor the fix, but the exception violations at the "realize" or "show" or "block" statements are almost always mean you violated rule 5.

As for rule 3; sometimes the wierd connection rules for some DBEs will force you to declare and place some invisible DBEs
(typically a "label" which you erase after "realize"); place your 1st DBEs over these lables,
and attach subsequent DBEs relative to the invisible labels rather than the visible DBEs.

DBE  dbeInvis1, dbeInvis2
 
dbeInvis1 = label(db, "abcde") // when you see the dialog, you end up changing this to "abcde "!
beside db
dbeInvis2 = label(db, "")
left db
dbeTopLeft = whatever
dbeSubsequent = whatever
dbeTopLeft ->"left" ->"aligned" ->dbeInvis1
dbeTopLeft ->"top"  ->"aligned" ->dbeInvis1
dbeSubsequent ->"top" and "left" ->relative to dbeTopLeft
 
dbeTroublePlacement = text(..)
dbeTroublePlacement ->"top" ->relative to some real DBE
dbeTroublePlacement ->"left" ->"aligned" ->dbeInvis2
realize(db)
set(dbeInvis1, "")


A clothes-pin on your nose helps when doing such coding.

There are times you will need these:
dbe3 ->"right" ->"unattached" // or ->"form"
dbe3 ->"bottom" ->"unattached"

After realize, sometimes:
setExtraHeightShare(dbe3, .5)
setExtraHeightShare(dbe4, .5)
setExtraWidthShare(dbe4, 1.0)

-Louie

Re: Problem with DBE placement
Bruwbruw - Wed Aug 08 06:54:21 EDT 2012

Thank you.
Now its exactly the way I wanna.
I you remember these rules!